package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName health_record
 */
@TableName(value ="health_record")
@Data
public class HealthRecord {
    /**
     * 
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    /**
     * 
     */
    @TableField(value = "elderly_id")
    private Integer elderlyId;

    /**
     * 
     */
    @TableField(value = "measure_date")
    private Date measureDate;

    /**
     * 
     */
    @TableField(value = "blood_pressure")
    private String bloodPressure;

    /**
     * 
     */
    @TableField(value = "blood_sugar")
    private BigDecimal bloodSugar;

    /**
     * 
     */
    @TableField(value = "heart_rate")
    private Integer heartRate;

    /**
     * 
     */
    @TableField(value = "note")
    private String note;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        HealthRecord other = (HealthRecord) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getMeasureDate() == null ? other.getMeasureDate() == null : this.getMeasureDate().equals(other.getMeasureDate()))
            && (this.getBloodPressure() == null ? other.getBloodPressure() == null : this.getBloodPressure().equals(other.getBloodPressure()))
            && (this.getBloodSugar() == null ? other.getBloodSugar() == null : this.getBloodSugar().equals(other.getBloodSugar()))
            && (this.getHeartRate() == null ? other.getHeartRate() == null : this.getHeartRate().equals(other.getHeartRate()))
            && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getMeasureDate() == null) ? 0 : getMeasureDate().hashCode());
        result = prime * result + ((getBloodPressure() == null) ? 0 : getBloodPressure().hashCode());
        result = prime * result + ((getBloodSugar() == null) ? 0 : getBloodSugar().hashCode());
        result = prime * result + ((getHeartRate() == null) ? 0 : getHeartRate().hashCode());
        result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", measureDate=").append(measureDate);
        sb.append(", bloodPressure=").append(bloodPressure);
        sb.append(", bloodSugar=").append(bloodSugar);
        sb.append(", heartRate=").append(heartRate);
        sb.append(", note=").append(note);
        sb.append("]");
        return sb.toString();
    }
}